import java.util.Arrays;
import java.util.Scanner;

public class Text3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[3*n];
        for (int i = 0; i < 3*n; i++) {
            arr[i]=sc.nextInt();
        }

        Arrays.sort(arr);
        int max=0;
        for (int i = n; i < 3*n; i+=2) {
            max+=arr[i];
        }

        System.out.println(max);
    }
}
